﻿@model BlackBird.Models.BiJiaDanDM
@using BlackBird.ControllerHelpers
@using BlackBird.Models
@using BlackBird.Resources         

@{
    ViewBag.State = Model.Status;
}

@section title_toolbar
{

    <nav>
        <ul id="button_command">
           @if (ViewData["isReadOnly"].ToString().Equals("false", StringComparison.OrdinalIgnoreCase))
            {
            <li><a class="uploadFile">@BBStrings.UploadFile</a></li>
            }
            <li><span class="returnHome">@Html.ActionLink(BBStrings.ReturnHome, "Index", "Home")</span></li>
        </ul>
    </nav>
}

<div id="navigator">
    @{Html.RenderPartial(MVC.Shared.Views.BiJiaDan.Navigator);}
</div>


<div id = "bijiadan_shenhe" data-id = "@Model.Id" data-type="@SupportTypes.BiJiaDan">
    @using (Html.BeginForm(MVC.BiJiaDan.ResolveBiJiaDan(), FormMethod.Post))
    { 
            @Html.ValidationSummary(true)
        <div id="bijiadan_edit_area">
        <div class="sectionheader">比价表</div>       
       @*Render partial view must include in a div*@
        <div id = "bijiadan">
            <div id="bijiadan_top">
            @{Html.RenderPartial(MVC.Shared.Views.BiJiaDan.BiJiaDanTop, Model);}
            </div>

            <div  id="bijiadan_main">
            @{Html.RenderPartial(MVC.Shared.Views.BiJiaDan.BiJiaDanTable, Model.table);}            
            </div>
            
            <div id="bijiadan_bottom">
            @{Html.RenderPartial(MVC.Shared.Views.BiJiaDan.BiJiaDanBottom, Model);}
            </div>
        </div> 
        
        <br/>
        <div id="ShenheHistoryRecord">
        @{Html.RenderPartial(MVC.Shared.Views.BiJiaDan.ShenheHistoryRecord, Model);}    
        </div>
        
        <br />
        <div id="bijiadan_attached_files">
        @if (Model.AttachedFileList != null && Model.AttachedFileList.AttachedFiles.Count > 0)
        {
            <div>
            @{Html.RenderPartial(MVC.Shared.Views.Util.AttachedFileListView, Model.AttachedFileList);}    
            </div>
        }
        </div>
        
        <br />                                     
        <div id="shenhe">
            @{Html.RenderPartial(MVC.Shared.Views.BiJiaDan.Shenhe, Model);}
        </div>     
        </div>
        
        if (Model.Status == SupportTypeStatus.ShenHeWanCheng
                && ViewData["isCaigouyuan"].ToString().Equals("True", StringComparison.OrdinalIgnoreCase))
        {
            <input type="submit" value=@BBStrings.ZuoFei name="Action"/>
            <input type="submit" value=@BBStrings.GuiDang name="Action"/>
        }
        
        <div>
            @Html.HiddenFor(model => model.ParentId)
            @Html.HiddenFor(model => model.Id)
            @Html.HiddenFor(model => model.Status)
            @Html.HiddenFor(model => model.CreateUser_idUser)
            <span id="isReadOnly" class="hidden">@ViewData["isReadOnly"]</span>
        </div>
    }

</div>
